/*** Eclipse Class Decompiler plugin, copyright (c) 2012 Chao Chen (cnfree2000@hotmail.com) ***/
package com.qihoo.gamecenter.sdk.pay.j;

import android.content.Context;
import android.text.TextUtils;
import com.qihoo.gamecenter.sdk.common.h.d;
import com.qihoo.gamecenter.sdk.common.h.d.a;
import com.qihoo.gamecenter.sdk.common.i.f;
import com.qihoo.gamecenter.sdk.common.i.s;
import com.qihoo.gamecenter.sdk.pay.e.a;
import com.qihoo.gamecenter.sdk.pay.k.c;
import java.util.ArrayList;
import java.util.Map;
import java.util.TreeMap;
import org.json.JSONArray;
import org.json.JSONObject;

public class o extends d {
    public o(Context paramContext, d.a parama) {
        super(paramContext, parama, true);
    }

    protected String a(Context paramContext, String[] paramArrayOfString) {
        return null;
    }

    protected String a() {
        return "http://mgame.360.cn/bankpay/get_bind_cards.json";
    }

    protected boolean b() {
        return true;
    }

    protected Map b(Context paramContext, String[] paramArrayOfString) {
        String str1 = a(0, paramArrayOfString);
        if (TextUtils.isEmpty(str1)) {
            c.a("OAGetBindCardsTask", new Object[] { "GetBindCards: qihooId is null!" });
            return null;
        }
        String str2 = a(1, paramArrayOfString);
        if (TextUtils.isEmpty(str2)) {
            c.a("OAGetBindCardsTask", new Object[] { "GetBindCards: access token is null!" });
            return null;
        }
        String str3 = a(2, paramArrayOfString);
        if (TextUtils.isEmpty(str3)) {
            c.a("OAGetBindCardsTask", new Object[] { "GetBindCards: require page is null!" });
            return null;
        }
        TreeMap localTreeMap = new TreeMap();
        localTreeMap.put("user_id", str1);
        localTreeMap.put("app_key", s.r(paramContext));
        localTreeMap.put("t", String.valueOf(System.currentTimeMillis()));
        localTreeMap.put("access_token", str2);
        localTreeMap.put("page", str3);
        String str4 = com.qihoo.gamecenter.sdk.pay.e.b.a(paramContext);
        c.a("OAGetBindCardsTask", new Object[] { "quickInfo=", str4 });
        if (!(TextUtils.isEmpty(str4)))
            localTreeMap.put("quick_info", str4);
        String str5 = com.qihoo.gamecenter.sdk.pay.e.b.b(paramContext);
        c.a("OAGetBindCardsTask", new Object[] { "riskControl=", str5 });
        if (!(TextUtils.isEmpty(str5)))
            localTreeMap.put("risk_control", str5);
        String str6 = s.a(localTreeMap, s.s(paramContext));
        c.a("OAGetBindCardsTask", new Object[] { "params=", str6 });
        this.a = s.b();
        String str7 = f.c(str6, this.a);
        String str8 = com.qihoo.gamecenter.sdk.common.f.b.a().a(this.a);
        localTreeMap = new TreeMap();
        localTreeMap.put("k", str8);
        localTreeMap.put("d", str7);
        c.a("OAGetBindCardsTask", new Object[] { a(), "?k=", str8, "&d=", str7 });
        return localTreeMap;
    }

    protected a b(JSONObject paramJSONObject) {
        if (paramJSONObject != null) {
            ArrayList localArrayList = null;
            int i = paramJSONObject.optInt("error_code", -1);
            String str = paramJSONObject.optString("error_msg");
            if (i == 0) {
                localObject = paramJSONObject.optJSONArray("cards");
                if (localObject != null) {
                    int j = ((JSONArray) localObject).length();
                    localArrayList = new ArrayList(j);
                    for (int k = 0; k < j; ++k) {
                        a locala = a.a(((JSONArray) localObject).optJSONObject(k));
                        if (locala == null)
                            continue;
                        localArrayList.add(locala);
                    }
                    c.a("OAGetBindCardsTask", new Object[] { "bindCards=", localArrayList.toString() });
                }
            }
            Object localObject = new a();
            ((a) localObject).a(i);
            ((a) localObject).a(str);
            ((a) localObject).a(localArrayList);
            return localObject;
        }
        return ((a) null);
    }

    public static class a {
        private int a = -1;
        private String b = null;
        private ArrayList c = null;

        public int a() {
            return this.a;
        }

        public void a(int paramInt) {
            this.a = paramInt;
        }

        public void a(String paramString) {
            this.b = paramString;
        }

        public ArrayList b() {
            return this.c;
        }

        public void a(ArrayList paramArrayList) {
            this.c = paramArrayList;
        }
    }
}